<?php
class NewsModel extends Model{

    public function  __construct() {
        parent::Model();
    }

    public function n_list($limit,$offset){
        $this->db->limit($limit,$offset);
        return $this->db->get('news')->result();
    }

    public function find($id){
        $this->db->where(array('id'=>$id));
        $this->db->limit(1);
        $query = $this->db->get('news');
        return $query->num_rows>0?$query->row():false;
    }

    public function n_count(){
        return $this->db->count_all('news');
    }
}
